﻿<navigation:Page 
    x:Class="OrgStructure.Page1" 
    mc:Ignorable="d"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
    d:DesignWidth="740" d:DesignHeight="500"
    Title="Магазины">
    
    <Grid x:Name="LayoutRoot" Background="White" Margin="10">
        
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="30" />
        </Grid.RowDefinitions>
        
        <sdk:DataGrid x:Name="dataGrid1">
            <sdk:DataGrid.RowGroupHeaderStyles>
                <!-- Style for groups at top level -->
                <Style TargetType="sdk:DataGridRowGroupHeader">
                    <Setter Property="PropertyNameVisibility" Value="Collapsed" />
                    <Setter Property="Background" Value="#FF112255" />
                    <Setter Property="Foreground" Value="#FFEEEEEE" />
                    <Setter Property="SublevelIndent" Value="15" />
                </Style>
                <!-- Style for groups under the top level -->
                <Style TargetType="sdk:DataGridRowGroupHeader">
                    <Setter Property="Background" Value="#44225566" />
                </Style>
            </sdk:DataGrid.RowGroupHeaderStyles>
            <sdk:DataGrid.RowDetailsTemplate>
                <!-- Begin row details section. -->
                <DataTemplate>
                    <Border BorderBrush="Black" BorderThickness="1" Background="Azure">
                        <StackPanel Orientation="Horizontal">
                            <StackPanel>
                                <StackPanel Orientation="Vertical">
                                    <!-- Controls are bound to SPUser properties. -->
                                    <TextBlock 
                                        FontSize="16" Foreground="MidnightBlue" 
                                        Text="{Binding ФИО}" 
                                        Margin="0,0,10,0" 
                                        VerticalAlignment="Bottom" />
                                    <TextBlock FontSize="12" Foreground="DarkBlue"
                                            Text="{Binding Офис}" />
                                    <TextBlock FontSize="12" Foreground="DarkBlue"
                                            Text="{Binding Отдел}" />
                                    <TextBlock FontSize="12" Foreground="DarkBlue"
                                            Text="{Binding Должность}" />
                                    <TextBlock FontSize="12" Foreground="DarkBlue"
                                            Text="{Binding Path=Тел, StringFormat=Тел. - \{0\}}" />
                                    <HyperlinkButton 
                                            Content="{Binding Path=EMail, StringFormat=EMail - \{0\}}"
                                            NavigateUri="{Binding Path=EMail, StringFormat=mailto:\{0\}}" 
                                            TargetName="_blank" />
                                    <ContentControl />
                                    <HyperlinkButton 
                                            Content="Сайт"
                                            NavigateUri="{Binding Path=SiteUrl}" 
                                            TargetName="_blank" />

                                    <Grid>
                                        
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition MinWidth="50" MaxWidth="300" Width="180" />
                                            <ColumnDefinition MinWidth="50" MaxWidth="200" Width="150" />
                                            <ColumnDefinition MinWidth="50" MaxWidth="200" Width="150" />
                                            <ColumnDefinition Width="40*" />
                                        </Grid.ColumnDefinitions>
                                        
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="155" />
                                            <RowDefinition/>
                                        </Grid.RowDefinitions>
                                        
                                        <StackPanel Grid.Column="0" Grid.Row="0" Grid.RowSpan="1" Grid.ColumnSpan="1">

                                            <Image 
                                                    Height="120"
                                                    Source="{Binding Path=ImageUrl}"
                                                    HorizontalAlignment="Left" VerticalAlignment="Top"
                                                    >
                                            </Image>

                                        </StackPanel>
                                        <StackPanel Grid.Column="1" Grid.Row="0" Grid.RowSpan="1" Grid.ColumnSpan="1">
                                            <Button 
                                                    Name="oTest" 
                                                    Content="Дополнительно" 
                                                    Height="23" Width="120" 
                                                    Margin="10,0,10,0" 
                                                    VerticalAlignment="Top"
                                                    HorizontalAlignment="Left"
                                                    Click="oTest_Click" >
                                                <Button.Effect>
                                                    <DropShadowEffect 
                                                        Color="Black" 
                                                        Direction="320" 
                                                        ShadowDepth="25" 
                                                        BlurRadius="5" 
                                                        Opacity="0.5" />
                                                </Button.Effect>
                                            </Button>
                                        </StackPanel>
                                        <StackPanel Grid.Column="2" Grid.Row="0" Grid.RowSpan="1" Grid.ColumnSpan="1">
                                            <Button 
                                                    Name="oTest2" 
                                                    Content="Документы" 
                                                    Height="23" Width="120" Margin="10,0,10,0" 
                                                    VerticalAlignment="Top" HorizontalAlignment="Left"
                                                    Click="oTest_Click" >
                                                <Button.Effect>
                                                    <DropShadowEffect 
                                                Color="Black" 
                                                Direction="320" 
                                                ShadowDepth="25" 
                                                BlurRadius="5" 
                                                Opacity="0.5" />
                                                </Button.Effect>
                                            </Button>
                                        </StackPanel>
                                        
                                    </Grid>
                                    
                                    <ContentControl />
                                    <ContentControl />
                                </StackPanel>
                                <!--<TextBlock FontSize="12" Text="Notes: " />
                                    <TextBox FontSize="12" 
                                             Text="{Binding Notes, Mode=TwoWay}" 
                                             Width="420" TextWrapping="Wrap"/>-->
                            </StackPanel>
                        </StackPanel>
                    </Border>
                </DataTemplate>
                <!-- End row details section. -->
            </sdk:DataGrid.RowDetailsTemplate>
        </sdk:DataGrid>
        
        <StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center">
            <Button Content="+" Margin="10,0,0,0" Click="Button_Click_Expand" />
            <Button Content=" - " Margin="5,0,0,0" Click="Button_Click_Collapse" />
            <TextBlock Text="   Поиск : " >
            </TextBlock>
            <TextBox 
                Name="oFindText" Text="" 
                Width="250"
                BorderThickness="2"
                TextChanged="TextBox_TextChanged"></TextBox>
        </StackPanel>
        
    </Grid>
    
</navigation:Page>
